package march.test_3_25;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int y1 = scanner.nextInt();
            int m1 = scanner.nextInt();
            int d1 = scanner.nextInt();
            int y2 = scanner.nextInt();
            int m2 = scanner.nextInt();
            int d2 = scanner.nextInt();
            int result = 0;
            result += result(y1,m1++,d1);
            result -= result(y2,m2++,d2+1);
            for (int i = y1; i <= y2; i++) {
                if(y1 == y2) {
                    for (int j = m1; j < m2; j++) {
                        if(j == 2 || j == 3|| j==5||j ==7||j == 11) {
                            result += (monthDay(y1,j) + 1);
                        } else {
                            result += (2*monthDay(y1,j) + 2);
                        }
                    }
                    break;
                }
                if(isRy(i)) {
                    result += 519;
                } else {
                    result += 518;
                }
            }
            System.out.println(result);
        }
    }
    public static boolean isRy(int y) {
        if((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) {
            return true;
        }
        return false;
    }
    public static int monthDay(int y,int m) {
        switch (m) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                return 31;
            case 2:
                if (isRy(y)) {
                    return 29;
                } else {
                    return 28;
                }
            default:
                return 30;
        }
    }
    public static int result(int y,int m,int d) {
        if(m==2||m==3||m==5||m==7||m==11) {
            return monthDay(y,m) - d+1;
        } else {
            return 2*(monthDay(y,m) - d + 1);
        }
    }
}
